<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title> IOS商城配置</title>
	<meta name="keywords" content="">
	<meta name="description" content="">
	<link rel="shortcut icon" href="favicon.ico"> <link href="__STATIC__/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
	<link href="__STATIC__/css/font-awesome.css?v=4.4.0" rel="stylesheet">
	<link href="__STATIC__/css/plugins/jqgrid/ui.jqgrid.css?0820" rel="stylesheet">
	<link href="__STATIC__/css/animate.css" rel="stylesheet">
	<link href="__STATIC__/css/style.css?v=4.1.0" rel="stylesheet">
	<link href="__STATIC__/css/new_file.css" rel="stylesheet">
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content  animated fadeInRight">
	<div class="row">
		<div class="col-sm-12">
			<div class="ibox ">
				<div class="ibox-title">
					<h5>IOS商城</h5>
				</div>
				<div class="toogl_body">
					<a href="Club.html"><button type="button" class="btn btn-w-m btn-bt btn-white">俱樂部管理</button></a>
					<a href="Club_configure.html"><button type="button" class="btn btn-w-m btn-white btn-bt">鑽石配置</button></a>
					<a href="Club_establish.html"><button type="button" class="btn btn-w-m btn-bt btn-white">創建俱樂部</button></a>
					<a href="Club_goldcoin.html"><button type="button" class="btn btn-w-m btn-info btn-bt">金幣配置</button></a>
					<a href="Club_grant.html"><button type="button" class="btn btn-w-m btn-white btn-bt">金幣發放</button></a>
					<a href="Club_conf.html"><button type="button" class="btn btn-w-m btn-white btn-bt">俱樂部配置</button></a>
					<hr style="clear: both;"/>
					<a href="Club_ios.html"><button type="button" class="btn btn-w-m btn-info btn-bt" data-toggle="modal" data-target="#myModal">IOS商品</button></a>
					<a href="Club_android.html"><button type="button" class="btn btn-w-m btn-white" data-toggle="modal" data-target="#myModal">Android商品</button></a>
					<a href="Club_goldcoin.html"><button type="button" class="btn btn-w-m btn-white" data-toggle="modal" data-target="#myModal">第三方商品</button></a>
					<hr style="clear: both;"/>
					<a><button type="button" class="btn btn-w-m btn-white" data-toggle="modal" data-target="#myModal">添加商品</button></a>
					<a href="Club_ios_1.html"><button type="button" class="btn btn-w-m btn-white">歷史記錄</button></a>
					<!-- <div class="form-group"><br/>
                        <label class="col-sm-2 control-dy">查询时间：</label>
                        <div class="col-sm-8 form-time1">
                            <input type="text" placeholder="请输入查询时间段" class="form-control form-time-bk" id="time1" readonly="readonly">
                        </div>
                        <label class="col-sm-2 control-dy">商品ID：</label>
                        <div class="col-sm-8 form-time1">
                            <input type="text" placeholder="请输入商品ID" class="form-control form-time-bk">
                        </div>
                        <button type="button" class="btn btn-w-m btn-info">查询</button>
                    </div> -->
					<div class="ibox-content ibox-jqGrid">
						<div class="jqGrid_wrapper">
							<table id="table_list_1"></table>
							<div id="pager_list_1"></div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<!-- 添加  -->
<div id="myModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div id="gray_Nr">
		<div class="col-sm-6">
			<div class="ibox float-e-margins float-e-margins-2">
				<div class="ibox-title">
					<h5>提示消息</h5>
					<div class="ibox-tools" data-dismiss="modal">
						<a class="close-link">
							<i class="fa fa-times"></i>
						</a>
					</div>
				</div>
				<div class="panel-body">
					<div class="ibox float-e-margins float-e-border">
						<div class="ibox-content">
							<form class="form-horizontal">
								<div class="form-group">
									<label class="col-sm-2 control-label">商品ID：</label>
									<div class="col-sm-8">
										<input type="text" class="form-control" readonly="readonly">
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">商品位置：</label>
									<div class="col-sm-8">
										<input type="text" class="form-control" id="add_goods_position">
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">金幣數量：</label>
									<div class="col-sm-8">
										<input type="text" class="form-control" id="add_gold_number">
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">贈送金幣數量：</label>
									<div class="col-sm-8">
										<input type="text" class="form-control" id="add_give">
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">價格：</label>
									<div class="col-sm-8">
										<input type="text" placeholder="單位（元）" class="form-control" id="add_price">
									</div>
								</div>
							</form>
						</div>
					</div>
					<div class="ibox-butz">
						<input class="btn btn-w-m btn-info" type="button" value="確定" onclick="club_gold()">
						<input class="btn btn-w-m" type="button" data-dismiss="modal" value="取消">
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<!--添加 end-->
<!-- 修改  -->
<div id="myModal2" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div id="gray_Nr">
		<div class="col-sm-6">
			<div class="ibox float-e-margins float-e-margins-2">
				<div class="ibox-title">
					<h5>提示消息</h5>
					<div class="ibox-tools" data-dismiss="modal">
						<a class="close-link">
							<i class="fa fa-times"></i>
						</a>
					</div>
				</div>
				<div class="panel-body">
					<div class="ibox float-e-margins float-e-border">
						<div class="ibox-content">
							<form class="form-horizontal">
								<div class="form-group">
									<label class="col-sm-2 control-label">商品ID：</label>
									<div class="col-sm-8">
										<input type="text" class="form-control" readonly="readonly" id="save_goods_id" value="">
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">商品位置：</label>
									<div class="col-sm-8">
										<input type="text" class="form-control" id="save_goods_position" value="111">
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">金幣數量：</label>
									<div class="col-sm-8">
										<input type="text" class="form-control" id="save_goods_number" value="">
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">贈送金幣數量：</label>
									<div class="col-sm-8">
										<input type="text" class="form-control" id="save_give">
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">價格：</label>
									<div class="col-sm-8">
										<input type="text" placeholder="單位（元）" class="form-control" id="save_goods_price" value="">
									</div>
								</div>
							</form>
						</div>
					</div>
					<div class="ibox-butz">
						<input class="btn btn-w-m btn-info" type="button" value="确定" onclick="club_gold_modify()">
						<input class="btn btn-w-m" type="button" data-dismiss="modal" value="取消">
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<!--修改 end-->

<!-- 下架   -->
<div id="myModal3" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div id="gray_Nr">
		<div class="col-sm-6">
			<div class="ibox float-e-margins float-e-margins-2">
				<div class="ibox-title">
					<h5>提示消息</h5>
					<div class="ibox-tools" data-dismiss="modal">
						<a class="close-link">
							<i class="fa fa-times"></i>
						</a>
					</div>
				</div>
				<div class="panel-body">
					<div class="ibox float-e-margins float-e-border">
						<div class="ibox-content">
							<form class="form-horizontal">
								<input type="hidden" name="" id="mshelves">
								<div class="form-texcan">是否確認下架?</div>
							</form>
						</div>
					</div>
				</div>
				<div class="ibox-butz">
					<input class="btn btn-w-m btn-info" type="button" value="確定" onclick="gold_goods_mshelves()">
					<input class="btn btn-w-m" type="button" data-dismiss="modal" value="取消">
				</div>
			</div>
		</div>
	</div>
</div>
<!--下架 end-->
<!-- 上架   -->
<div id="myModal4" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div id="gray_Nr">
		<div class="col-sm-6">
			<div class="ibox float-e-margins float-e-margins-2">
				<div class="ibox-title">
					<h5>提示消息</h5>
					<div class="ibox-tools" data-dismiss="modal">
						<a class="close-link">
							<i class="fa fa-times"></i>
						</a>
					</div>
				</div>
				<div class="panel-body">
					<div class="ibox float-e-margins float-e-border">
						<div class="ibox-content">
							<form class="form-horizontal">
								<input type="hidden" name="" id="shelves">
								<div class="form-texcan">是否重新上架？</div>
							</form>
						</div>
					</div>
				</div>
				<div class="ibox-butz">
					<input class="btn btn-w-m btn-info" type="button" value="確定" onclick="gold_goods_shelves()">
					<input class="btn btn-w-m" type="button" data-dismiss="modal" value="取消">
				</div>
			</div>
		</div>
	</div>
</div>
<!--上架 end-->
<!-- 删除   -->
<div id="myModal5" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div id="gray_Nr">
		<div class="col-sm-6">
			<div class="ibox float-e-margins float-e-margins-2">
				<div class="ibox-title">
					<h5>提示消息</h5>
					<div class="ibox-tools" data-dismiss="modal">
						<a class="close-link">
							<i class="fa fa-times"></i>
						</a>
					</div>
				</div>
				<div class="panel-body">
					<div class="ibox float-e-margins float-e-border float-zjb">
						<div class="ibox-content">
							<form class="form-horizontal">
								<input type="hidden" name="" id="del">
								<div class="form-texcan">刪除將無法恢復</div>
							</form>
						</div>
					</div>
				</div>
				<div class="ibox-butz">
					<input class="btn btn-w-m btn-info" type="button" value="確定" onclick="gold_goods_del()">
					<input class="btn btn-w-m" type="button" data-dismiss="modal" value="取消">
				</div>
			</div>
		</div>
	</div>
</div>
<!--删除 end-->
<script src="__STATIC__/js/jquery.min.js?v=2.1.4"></script>
<script src="__STATIC__/js/bootstrap.min.js?v=3.3.6"></script>
<script src="__STATIC__/js/plugins/peity/jquery.peity.min.js"></script>
<script src="__STATIC__/js/plugins/jqgrid/i18n/grid.locale-cn.js?0820"></script>
<script src="__STATIC__/js/plugins/jqgrid/jquery.jqGrid.min.js?0820"></script>
<script src="__STATIC__/js/content.js?v=1.0.0"></script>
<script src="__STATIC__/js/plugins/laydate/laydate.js"></script>
<script>
    function _getMessage(t) {
        var id = $(t).parent().parent().children().eq(0).html();//俱乐部id
        var save_goods_position = $(t).parent().parent().children().eq(1).html();//俱乐部名称
        var save_goods_number = $(t).parent().parent().children().eq(2).html();//俱乐部会长名
        var save_goods_price = $(t).parent().parent().children().eq(4).html();//俱乐部会id
        var save_give = $(t).parent().parent().children().eq(3).html();//俱乐部会id

        $('#save_goods_id').val(id);//修改商品id
        $('#save_goods_position').val(save_goods_position);//修改商品位置
        $('#save_goods_number').val(save_goods_number);//修改商品数量
        $('#save_goods_price').val(save_goods_price);//修改商品价格
        $('#save_give').val(save_give);//修改金币数量

        $('#shelves').val(id);//商品上架id
        $('#mshelves').val(id);//商品下架id

        $('#del').val(id);//商品删除id

    }
    //金币商城 商品添加
    function club_gold(){
        var goods_position = $('#add_goods_position').val();
        var gold_number = $('#add_gold_number').val();
        var price = $('#add_price').val();
        var give = $('#add_give').val();
        $.ajax({
            type: "post",
            url: "__URL__/club_gold_ios",
            data: {
                'goods_position':goods_position,
                'gold_number':gold_number,
                'price':price,
                'give':give,
            },
            dataType: "json",
            success: function(e) {
                // console.log(e);
                alert(e.msg);
                location.reload();
            },
            error: function(e) {
                // console.log(e);
                alert(e.msg);
            }
        });
    }
    //金币商城 商品修改
    function club_gold_modify(){
        var id = $('#save_goods_id').val();
        var goods_position = $('#save_goods_position').val();
        var gold_number = $('#save_goods_number').val();
        var price = $('#save_goods_price').val();
        var give = $('#save_give').val();
        $.ajax({
            type: "post",
            url: "__URL__/club_gold_modify_ios",
            data: {
                'id':id,
                'goods_position':goods_position,
                'gold_number':gold_number,
                'price':price,
                'give':give,
            },
            dataType: "json",
            success: function(e) {
                // console.log(e);
                alert(e.msg);
                location.reload();
            },
            error: function(e) {
                // console.log(e);
                alert(e.msg);
            }
        });
    }
    //金币商城 商品下架
    function gold_goods_mshelves(){
        var id = $("#shelves").val();
        var goods_position = $('#save_goods_position').val();
        var gold_number = $('#save_goods_number').val();
        var price = $('#save_goods_price').val();
        var give = $('#save_give').val();
        // console.log(id);
        $.ajax({
            type: "post",
            url: "__URL__/gold_goods_mshelves_ios",
            data: {
                'id':id,
                'goods_position':goods_position,
                'gold_number':gold_number,
                'price':price,
                'give':give,
            },
            dataType: "json",
            success: function(e) {
                // console.log(e);
                alert(e.msg);
                location.reload();
            },
            error: function(e) {
                // console.log(e);
                alert(e.msg);
            }
        });
    }
    //金币商城 商品上架
    function gold_goods_shelves(){
        var id = $("#mshelves").val();
        var goods_position = $('#save_goods_position').val();
        var gold_number = $('#save_goods_number').val();
        var price = $('#save_goods_price').val();
        var give = $('#save_give').val();
        $.ajax({
            type: "post",
            url: "__URL__/gold_goods_shelves_ios",
            data: {
                'id':id,
                'goods_position':goods_position,
                'gold_number':gold_number,
                'price':price,
                'give':give
            },
            dataType: "json",
            success: function(e) {
                // console.log(e);
                alert(e.msg);
                location.reload();
            },
            error: function(e) {
                // console.log(e);
                alert(e.msg);
            }
        });
    }
    //金币商城 商品删除
    function gold_goods_del(){
        var id = $("#del").val();
        var goods_position = $('#save_goods_position').val();
        var gold_number = $('#save_goods_number').val();
        var price = $('#save_goods_price').val();
        var give = $('#save_give').val();
        $.ajax({
            type: "post",
            url: "__URL__/gold_goods_del_ios",
            data: {
                'id':id,
                'goods_position':goods_position,
                'gold_number':gold_number,
                'price':price,
                'give':give
            },
            dataType: "json",
            success: function(e) {
                // console.log(e);
                alert(e.msg);
                location.reload();
            },
            error: function(e) {
                // console.log(e);
                alert(e.msg);
            }
        });
    }
    $(document).ready(function () {

        $('.clo-sj').hide();
        $('.clo-xl').hide();
        $('.form-consele1').on('change',function(){
            if ($('.form-consele1').val() == '0') {
                $('.clo-sj').hide();
            } else{
                $('.clo-sj').show();
            }
        });
        $('.form-consele2').on('change',function(){
            if ($('.form-consele2').val() == '0') {
                $('.clo-xl').hide();
            } else{
                $('.clo-xl').show();
            }
        });

        $.jgrid.defaults.styleUI = 'Bootstrap';
        // Examle data for jqGrid

        $("#table_list_1").jqGrid({
            url:'__URL__/club_gold_messsage_ios',
            postData:{},
            datatype: "json",
            mtype: 'POST',
            height: 450,
            autowidth: true,
            shrinkToFit: true,
            rowNum: 20,
            rowList: [20,50,100],
            colNames: ['商品ID', '商品位置', '金幣數量', '贈送金幣數量','價格(元)',  '修改','下架','刪除'],
            colModel: [

                {
                    name: 'id',
                    index: 'id',
                    width: 60,
                    sorttype: "int",
                    sortable: false,
                    align:'center'
                },
                {
                    name: 'goods_position',
                    index: 'goods_position',
                    width: 60,
                    sorttype: "int",
                    sortable: false,
                    align:'center'
                },
                {
                    name: 'gold_number',
                    index: 'gold_number',
                    width: 60,
                    sorttype: "int",
                    sortable: false,
                    align:'center'
                },
                {
                    name: 'give',
                    index: 'give',
                    width: 60,
                    sorttype: "int",
                    sortable: false,
                    align:'center'
                },
                {
                    name: 'price',
                    index: 'price',
                    width: 60,
                    sorttype: "int",
                    sortable: false,
                    align:'center'
                },
                {
                    name: 'isfinish',
                    index: 'isfinish',
                    width: 60,
                    formatter: function() {
                        return '<input type="button" value="修改" id="" data-toggle="modal" data-target="#myModal2" class="btn btn-info" onclick="_getMessage(this)"/>';
                    },
                    align:'center'
                },
                {
                    name: 'status',
                    index: 'status',
                    width: 60,
                    formatter: function(status) {
                        switch(Number(status)){
                            case 0:
                                return '<input type="button" style="background:	#FF8247" value="上架" id="" data-toggle="modal" data-target="#myModal4" class="btn btn-info" onclick="_getMessage(this)"/>';
                            case 1:
                                return '<input type="button" value="下架" id="" data-toggle="modal" data-target="#myModal3" class="btn btn-info" onclick="_getMessage(this)"/>';
                        }
                    },
                    align:'center'
                },
                {
                    name: 'isfinish',
                    index: 'isfinish',
                    width: 60,
                    formatter: function() {
                        return '<input type="button" value="刪除" id="" data-toggle="modal" data-target="#myModal5" class="btn btn-danger" onclick="_getMessage(this)"/>';
                    },
                    align:'center'
                }
            ],
            pager: "#pager_list_1",
            viewrecords: true,
            loadonce: true,
            caption: "IOS商城",
            hidegrid: false
        });
        $("#jd").hide();
        $(function(){
            $("#jd").click(function(){
                $("#jd").hide();
                $("#dj").show();
            });
            $("#dj").click(function(){
                $("#dj").hide();
                $("#jd").show();
            });
        });
        $("#fj").hide();
        $(function(){
            $("#fj").click(function(){
                $("#fj").hide();
                $("#jj").show();
            });
            $("#jj").click(function(){
                $("#jj").hide();
                $("#fj").show();
            });
        });
        $('.form-conselein').hide();
        $('.form-consele').on('change',function(){
            if ($('.form-consele').val() == '0') {
                $('.form-conselein').hide();
            } else{
                $('.form-conselein').show();
            }
        })
        $(window).bind('resize', function () {
            var width = $('.jqGrid_wrapper').width();
            $('#table_list_1').setGridWidth(width);
        });
        laydate.render({
            elem: '#time1'
            ,range: true
        });
        laydate.render({
            elem: '#time2'
            ,range: true
        });
    });
</script>


</body>

</html>